package com.jzo2o.customer.controller.worker;

import com.jzo2o.customer.model.dto.request.BankAccountUpsertReqDTO;
import com.jzo2o.customer.model.dto.response.BankAccountResDTO;
import com.jzo2o.customer.service.IBankAccountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author itcast
 */
@RestController("BankAccountController")
@RequestMapping("/worker/bank-account")
@Api(tags = "服务端 - 服务提交认证相关接口")
public class BankAccountController {

    @Resource
    private IBankAccountService bankAccountService;

    /**
     * 5.3.1 新增或更新银行账号信息接口
     */
    @PostMapping
    @ApiOperation("新增或更新银行账号信息")
    public void add(@RequestBody BankAccountUpsertReqDTO bankAccountUpsertReqDTO) {
        bankAccountService.addBankAccount(bankAccountUpsertReqDTO);
    }

    /**
     * 5.3.2 获取当前用户银行账号接口
     */
    @GetMapping("/currentUserBankAccount")
    @ApiOperation("获取当前用户银行账号")
    public BankAccountResDTO queryWorkerBankAccount() {
        return bankAccountService.queryWorkerBankAccount();
    }

}
